package com.zretc.controller;

import com.zretc.service.MovieCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/movieCollection")
public class MovieCollectController {
    @Autowired
    private MovieCollectionService movieCollectionService;

    @RequestMapping("/addMovieCollection")
    public int addMovieCollection(String movieId,
                                  String userId,
                                  String cinemaId){
        //获取系统时间戳
        long collectIdTime = System.currentTimeMillis();
        String collectId = collectIdTime+"";
        Map<String,String> params  = new HashMap<>();
        params.put("movieId",movieId);
        params.put("collectId",collectId);
        params.put("userId",userId);
        params.put("cinemaId",cinemaId);
        //调用业务方法
        int i = movieCollectionService.addMovieCollection(params);
        return i;
    }
}
